package edu.rakovic.elearning.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;


import edu.rakovic.elearning.interfaces.Content;

public class ContentsBean implements Contents {
	
public static long nextId = 1;
	
	private Map<String, Content> contents;
	
	public ContentsBean(){
		this(new HashMap<String, Content>());
	}
	
	public ContentsBean(HashMap<String, Content> contents) {
		  this.contents = contents;
	}


	public Content save(Content content) {
		content.setId("Content" + nextId++);
		return contents.put(content.getId(), content);
	}

}
